package com.feihong.yw189.activity.WebInterface;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;

import com.feihong.yw189.fragment.shouye.DingDanLieBiaoFragment;
import com.just.agentweb.AgentWeb;

/**
 * js交互接口
 * Created by PVer on 2018/1/4.
 */

public class OrderWebInterface {
    private final String TAG = "营维189";
    private AgentWeb agent;
    private Context context;
    private DingDanLieBiaoFragment.ActionCallBack callBack;

    public OrderWebInterface(AgentWeb agent, Context context, DingDanLieBiaoFragment.ActionCallBack callBack) {
        this.agent = agent;
        this.context = context;
        this.callBack = callBack;
    }

    private Handler deliver = new Handler(Looper.getMainLooper());

    //发送签名数据
    @JavascriptInterface
    public String getToken() {
        return callBack.getToken();
    }

    //发送签名数据
    @JavascriptInterface
    public boolean setToken(String info) {
        return callBack.setToken(info);
    }

    //发送签名数据
    @JavascriptInterface
    public String getSign(String info) {
        return callBack.sendSign(info);
    }

    @JavascriptInterface
    public String getOrderSn(String info){
        return callBack.sendSign(info);
    }


    @JavascriptInterface
    public Boolean toOrderInfo(String info){
        return callBack.toOrderInfo(info);
    }
}
